package com.ysstech.reportworld.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author lishuangliang
 * @since 2022-04-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("report_world_table")
public class Table extends Model<Table> {

    private static final long serialVersionUID = 1L;

    @TableId("ID")
    private String id;

    /**
     * 表名
     */
    @TableField("NAME")
    private String name;

    /**
     * 中文表名
     */
    @TableField("CHINESE_NAME")
    private String chineseName;

    /**
     * 表说明
     */
    @TableField("DESCRIPTION")
    private String description;

    /**
     * 报表世界所在分层
     */
    @TableField("LAYERED")
    private Integer layered;

    /**
     * 版本号
     */
    @TableField("VERSION")
    private String version;
    /**
     * 类型
     */
    @TableField("FTYPE")
    private Integer ftype;
    /**
     * 来源
     */
    @TableField("FSOURCE")
    private Integer fsource;


    /**
     * 原始表，remane来源的表
     */
    @TableField("ORIGINAL_TABLE_NAME")
    private String originalTableName;

    /**
     * 读取Execl时候的文件名称
     */
    @TableField("FILE_NAME")
    private String fileName;

    /**
     * 状态
     */
    @TableField("STATUS")
    private Integer status;

    @TableField("ADD_TIME")
    private LocalDateTime addTime;

    @TableField("ADD_USER")
    private String addUser;

    @TableField("EDIT_TIME")
    private LocalDateTime editTime;

    @TableField("EDIT_USER")
    private String editUser;

    @TableField("DELETE_REASON")
    private String deleteReason;

    @Override
    protected Serializable pkVal() {
        return null;
    }

    //页面展示的中文字段
    //报表世界所在分层
    @TableField(exist = false)
    private String strLayered;
    // 状态
    @TableField(exist = false)
    private String strStatus;
    //类型
    @TableField(exist = false)
    private String strFtype;
    //来源
    @TableField(exist = false)
    private String strFsource;
    // 所属模块
    @TableField(exist = false)
    private String modular;
    //所属客户
    @TableField(exist = false)
    private String customer;
    //所属报表
    @TableField(exist = false)
    private String report;
    //集市层依赖的表信息
    @TableField(exist = false)
    private String marketTables;

    // 所属模块
    @TableField(exist = false)
    private String strModular;
    //所属客户
    @TableField(exist = false)
    private String strCustomer;
    //所属报表
    @TableField(exist = false)
    private String strReport;

    //一个表对应客户集合
    @TableField(exist = false)
    private List<DataCustomer> listCustomer;
    //一个表对应模块集合
    @TableField(exist = false)
    private List<DataModular> listModular;
    //一个表对应报表集合
    @TableField(exist = false)
    private List<DataReport> listReport;

    //选中的表信息
    @TableField(exist = false)
    private List<Table> listTable;

    // 表关联关系id
    @TableField(exist = false)
    private String tabletableId;
    @TableField(exist = false)
    private String columnId;
    @TableField(exist = false)
    private String columnName;
    @TableField(exist = false)
    private String columnChineseName;
    @TableField(exist = false)
    private String codeName;


    //一个表对应客户集合
    @TableField(exist = false)
    private List<String> listCustomerStr;
    @TableField(exist = false)
    private List<String> listModularStr;
    @TableField(exist = false)
    private List<String> listReportStr;
    /**
     * 表的索引信息
     */
    @TableField(exist = false)
    private List<TableIndexed> listIndexed;
    /**
     * 表详细信息
     */
    @TableField(exist = false)
    private List<TableDetail> listTableDetail;
    /**
     * 表修改记录信息
     */
    @TableField(exist = false)
    private List<DataDemandBug> listDataDemandBug;
    /**
     * 表详细信息
     */
    @TableField(exist = false)
    private LinkedHashMap<String, TableDetail> mapTableDetail;

    @TableField(exist = false)
    private Integer count;
}
